package com.wowudi.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wowudi.service.DrugRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wowudi.mapper.DrugRecordMapper;
import com.wowudi.domain.DrugRecord;

@Service
public class DrugRecordServiceImpl extends ServiceImpl<DrugRecordMapper, DrugRecord> implements DrugRecordService {

    @Autowired
    DrugRecordMapper DrugRecordMapper;

    @Override
    public boolean addDrugRecord(DrugRecord DrugRecord) {
        return DrugRecordMapper.insert(DrugRecord)>0?true:false;
    }

    @Override
    public Page findRecord(int size, int current, String name,String ks,String js) {
        Page Page=new Page();
        Page.setSize(size);
        Page.setCurrent(current);
        return DrugRecordMapper.findRecordAll(Page,name,ks,js);
    }

    @Override
    public boolean delRecordById(int id) {
        return DrugRecordMapper.deleteById(id)>0?true:false;

    }

}
